{% extends "xadmin/edit_inline/base.html" %}
{% load i18n xadmin_tags crispy_forms_tags %}

{% block box_content_class %}{{ block.super }} nopadding{% endblock box_content_class %}

{% block formset_form %}
  <div class="formset-row">
    <div class="formset-heading">
      {% if formset.formset.can_delete %}
        <a class="delete-row pull-right"><i class="icon icon-remove"></i></a>
      {% endif %}
      <b>{{ formset.opts.verbose_name|title }}:</b>&nbsp;{% if fs.instance.pk %}{{ fs.instance }}{% else %}#<span class="formset-num">{{ forloop.counter }}</span>{% endif %}
    </div>
    <div class="formset-form">
      {% crispy fs formset.formset.helper %}
    </div>
  </div>
{% endblock formset_form %}

{% block formset_empty %}
  <div class="formset-row">
    <div class="formset-heading">
      {% if formset.formset.can_delete %}
        <a class="delete-row pull-right"><i class="icon icon-remove"></i></a>
      {% endif %}
      <b>{{ formset.opts.verbose_name|title }}:</b>&nbsp;#<span class="formset-num"></span>
    </div>
    <div class="formset-form">
      {% crispy formset.formset.empty_form formset.formset.helper %}
    </div>
  </div>
{% endblock formset_empty %}